home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1990 / Jul 90 / MacApp.Tech$ 7⁄13⁄90 / 1575-MATextBox problem...-Jul90 < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.5 KB  |  43 lines  |  [TEXT/GEOL]

  1. Item    8103847                         10-July-90        16:06PDT
  2.  
  3. From:   VERITY                          Verity, Bob Williams,PRT
  4.  
  5. To:     MACDTS                          Macintosh Developer Tech Supt
  6.         MACAPP.TECH$                    MacApp Technical
  7.  
  8. Sub:    MATextBox problem...
  9.  
  10.  
  11. Hi,
  12.  
  13. I've found what might well be a bug in MATextBox as used by TStaticText, or at
  14. least in my understanding of it or my understanding of fonts.  I've created a
  15. custom font which is identical to Chicago-12 except for some special characters
  16. that I added - the key point, as will become clear below, is that the widest of
  17. these special characters is 58 pixels, which is far wider than the rest of
  18. Chicago-12.
  19.  
  20. When I try to display a right-justified string in this font in a TStaticText,
  21. MATextBox causes the destination rectangle of its private TE to be wider than
  22. the size of the TStaticText, which causes half the text to be imaged to the
  23. right of the TStaticText box.  The following snippet from MATextBox illustrates
  24. the problem quite explicitly - it assumes that the widest character of any font
  25. is always smaller than any given string in that font, which obviously isn't
  26. true.
  27.  
  28.  
  29.    { Enforce minimum width on destRect ala IM-I pp. 383.  Although the text
  30. says that
  31.    20 is a good number, using the widMax ensures that it is correct for all
  32. font sizes. }
  33.    WITH destRect DO
  34.    right := left + Max(Max(right - left, widMax), 20);
  35.  
  36.  
  37. This seems completely wrong to me - can someone enlighten me?
  38.  
  39. Anders Wallgren
  40. Verity, Inc.
  41. Applelink: VERITY
  42.  
  43.